import { Component, OnInit } from '@angular/core';
import { _HttpClient } from '@delon/theme';
import {AppUrl} from '../../../app.url';
import {HttpClient} from '@angular/common/http';
import {ActivatedRoute, Router} from '@angular/router';

@Component({
  selector: 'app-member-detail',
  templateUrl: './member-detail.component.html',
    styleUrls: [ './member-detail.component.less'],
})
export class MemberDetailComponent implements OnInit {

    memberList = {
        studentName :'',
        univName :'',
        univAdd:'',
        majorSub:'',
        special:'',
     campusName:'',
        position:''
    };
    activityList =[];
    memID;
    constructor(
        private http: HttpClient,private route: ActivatedRoute, private router: Router,
    ) {
        this.memID = this.route.snapshot.paramMap.get('studentId');

        this.http.post(AppUrl.student.memDetByMemID, {memId: this.memID }).subscribe(data => {
            console.log(data);
            let temp: any = data;
            this.memberList.studentName = temp.data.studentName;
            this.memberList.univName= temp.data.univName;
            this.memberList.univAdd = temp.data.univAdd;
            this.memberList.majorSub = temp.data.majorSub;
            this.memberList.special = temp.data.special;
            this.memberList.campusName= temp.data.campusName;
            this.memberList.position = temp.data.position;
        });


        this.http.post(AppUrl.activity.selectActListByMemId, {memId: this.memID }).subscribe(data => {
            console.log(data);
            let temp: any = data;
            this.activityList = temp.data;
        });
    }

    ngOnInit() {
    }

}
